package networkinstance;

public class Main6 {
    public static void main(String[] args) {
        try {
            java.net.URL url = new java.net.URL("http://www.runoob.com");
            java.net.HttpURLConnection httpCon = (java.net.HttpURLConnection) url.openConnection();
            long date = httpCon.getDate();
            if (date == 0)
                System.out.println("无法获取信息。");
            else
                System.out.println("Date: " + new java.util.Date(date));
        } catch (java.io.IOException e) {
            throw new RuntimeException(e);
        }
    }
}
